﻿using FreeSql.DataAnnotations;
using Jumei.Common.BaseModel;
using Jumei.Model.Admin;
using System;

namespace Jumei.Model.Business.ShopsManage
{
    /// <summary>
    /// 店铺表
    /// </summary>
    [Table(Name = "sp_shops")]
    [Index("idx_{tablename}_01", nameof(ShopSn), false)]
    public class ShopsEntity : EntityFull, ITenant
    {
        /// <summary>
        /// 租户Id
        /// </summary>
        [Column(Position = -10)]
        public long? TenantId { get; set; }

        /// <summary>
        /// 店铺编号
        /// </summary>
        public string ShopSn { get; set; }

        /// <summary>
        /// 店铺所有人ID	
        /// </summary>
        public long UserId { get; set; }

        public UserEntity User { get; set; }

        /// <summary>
        /// 区域路径
        /// </summary>
        [Column(StringLength = 255)]
        public string AreaIdPath { get; set; }

        /// <summary>
        /// 最终所属区域ID
        /// </summary>
        public int AreaId { get; set; }

        /// <summary>
        /// 是否自营
        /// 1:自营 
        /// 0:非自营
        /// </summary>
        public bool IsSelf { get; set; } = false;

        /// <summary>
        /// 店铺名称
        /// </summary>
        [Column(StringLength = 100)]
        public string ShopName { get; set; }

        /// <summary>
        /// 店主
        /// </summary>
        [Column(StringLength = 50)]
        public string Shopkeeper { get; set; }

        /// <summary>
        /// 店主手机号
        /// </summary>
        [Column(StringLength = 20)]
        public string Telephone { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        [Column(StringLength = 255)]
        public string ShopCompany { get; set; }

        /// <summary>
        /// 店铺图标
        /// </summary>
        [Column(StringLength = 150)]
        public string ShopImg { get; set; }

        /// <summary>
        /// 店铺电话
        /// </summary>
        [Column(StringLength = 40)]
        public string ShopTel { get; set; }

        /// <summary>
        /// QQ号
        /// </summary>
        [Column(StringLength = 40)]
        public string ShopQQ { get; set; }

        /// <summary>
        /// 旺旺号
        /// </summary>
        [Column(StringLength = 50)]
        public string ShopWangWang { get; set; }

        /// <summary>
        /// 店铺地址
        /// </summary>
        [Column(StringLength = 255)]
        public string ShopAddress { get; set; }

        /// <summary>
        /// 银行ID
        /// </summary>
        public int BankId { get; set; }

        /// <summary>
        /// 银行卡号
        /// </summary>
        [Column(StringLength = 20)]
        public string BankNo { get; set; }

        /// <summary>
        /// 能否开发票
        /// 1:能 
        /// 0:不能
        /// </summary>
        public bool IsInvoice { get; set; }

        /// <summary>
        /// 发票说明
        /// </summary>
        [Column(StringLength = 255)]
        public string InvoiceRemarks { get; set; }

        /// <summary>
        /// 开始营业时间
        /// </summary>
        public DateTime ServiceStartTime { get; set; }

        /// <summary>
        /// 结束营业时间
        /// </summary>
        public DateTime ServiceEndTime { get; set; }

        /// <summary>
        /// 店铺状态
        /// 1:营业中 
        /// 0：休息中
        /// </summary>
        public int ShopAtive { get; set; }

        /// <summary>
        /// 店铺状态
        /// -1:拒绝|停用 
        /// 0：未审核 
        /// 1:已审核
        /// </summary>
        public int ShopStatus { get; set; }

        /// <summary>
        /// 状态说明
        /// 一般用于停止和拒绝说明
        /// </summary>
        [Column(StringLength = 255)]
        public string StatusDesc { get; set; }

        /// <summary>
        /// 商家钱包
        /// </summary>
        public decimal ShopMoney { get; set; }

        /// <summary>
        /// 冻结金额
        /// </summary>
        public decimal LockMoney { get; set; }

        /// <summary>
        /// 未结算的订单数	
        /// </summary>
        public int NoSettledOrderNum { get; set; }

        /// <summary>
        /// 未结算的订单金额
        /// </summary>
        public int NoSettledOrderFee { get; set; }

        /// <summary>
        /// 需缴纳的佣金
        /// </summary>
        public decimal PaymentMoney { get; set; }

        /// <summary>
        /// 银行账号开卡地区
        /// </summary>
        public int BankAreaId { get; set; }

        /// <summary>
        /// 银行账号开卡地区ID路径
        /// </summary>
        [Column(StringLength = 100)]
        public string BankAreaIdPath { get; set; }

        /// <summary>
        /// 申请状态
        /// </summary>
        public ApplyStatusType ApplyStatus { get; set; }

        /// <summary>
        /// 申请失败原因
        /// </summary>
        [Column(StringLength = 255)]
        public string ApplyDesc { get; set; }

        /// <summary>
        /// 提交申请时间
        /// </summary>
        public DateTime ApplyTime { get; set; }

        /// <summary>
        /// 当前填写步骤
        /// </summary>
        public int ApplyStep { get; set; }

        /// <summary>
        /// 店铺公告
        /// </summary>
        [Column(StringLength = 300)]
        public string ShopNotice { get; set; }

        /// <summary>
        /// 充值金额
        /// </summary>
        public decimal RechargeMoney { get; set; }

        /// <summary>
        /// 经度
        /// </summary>
        public decimal Longitude { get; set; }

        /// <summary>
        /// 纬度
        /// </summary>
        public decimal Latitude { get; set; }

        /// <summary>
        /// 地图放大倍数	
        /// </summary>
        public int MapLevel { get; set; } = 16;

        /// <summary>
        /// 开店截止日期	
        /// </summary>
        public DateTime ExpireDate { get; set; }

        /// <summary>
        /// 是否支付
        /// </summary>
        public bool IsPay { get; set; }

        /// <summary>
        /// 入驻费用
        /// </summary>
        public decimal PayAnnualFee { get; set; }

        /// <summary>
        /// 是否退款
        /// </summary>
        public bool IsRefund { get; set; }

        /// <summary>
        /// 所属行业	
        /// </summary>
        public int TradeId { get; set; }

        /// <summary>
        /// 是否关闭操作指引
        /// 1:是 
        /// 0：否
        /// </summary>
        public bool IsGuide { get; set; }

        /// <summary>
        /// 商家佣金类型
        /// 1：商家佣金 
        /// 0：平台统一佣金
        /// </summary>
        public int CommissionType { get; set; }
    }
}
